package QL;

import java.util.List;
import java.util.ArrayList;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

public class ButlerGameGetRoomPlatformDetailResponse extends BaseQLResponse
{
    /// <summary>
    /// 捕鱼游戏台子详细列表
    /// </summary>
    public List<ButlerGameRoomPlatformDetail> DetailList;

    /// <summary>
    /// 在线玩家人数
    /// </summary>
    public long OnlineUserCount;

    @Override
    public void DeserializeFromJson(JSONObject jsonObj)
    {
        JSONObject t = jsonObj.getJSONObject("error_response");
        if (t != null && !t.isNullObject())
        {
            ErrCode = t.getString("code");
            ErrMsg = t.getString("msg");
        }
        else
        {
            t = jsonObj.getJSONObject("butler_game_get_room_platform_detail_response");
            DetailList = new ArrayList<ButlerGameRoomPlatformDetail>();
            JSONArray arrDetailList = t.getJSONObject("detail_list").getJSONArray("butler_game_room_platform_detail");
            for (int i = 0; i < arrDetailList.size(); ++i)
            {
                ButlerGameRoomPlatformDetail o = new ButlerGameRoomPlatformDetail();
                o.DeserializeFromJson(arrDetailList.getJSONObject(i));
                DetailList.add(o);
            }
            if (t.has("online_user_count"))
                OnlineUserCount = t.getLong("online_user_count");
        }
    }
}
